@using OrchardCore.Email.Workflows.ViewModels;
@model EmailTaskViewModel

<div class="form-group" asp-validation-class-for="AuthorExpression">
    <label asp-for="AuthorExpression">@T["From"]</label>
    <input type="text" asp-for="AuthorExpression" class="form-control code" />
    <span asp-validation-for="AuthorExpression"></span>
    <span class="hint">@T["The author's email address that defines who the email is from. Leave blank to use the configured email address. With Liquid support."]</span>
</div>

<div class="form-group" asp-validation-class-for="SenderExpression">
    <label asp-for="SenderExpression">@T["Sender"]</label>
    <input type="text" asp-for="SenderExpression" class="form-control code" />
    <span asp-validation-for="SenderExpression"></span>
    <span class="hint">@T["The sender's email address. Required if not the same as the From email address. With Liquid support."]</span>
</div>

<div class="form-group" asp-validation-class-for="RecipientsExpression">
    <label asp-for="RecipientsExpression">@T["Recipients"]</label>
    <input type="text" asp-for="RecipientsExpression" class="form-control code" />
    <span asp-validation-for="RecipientsExpression"></span>
    <span class="hint">@T["The comma-separated list of recipient email addresses. With Liquid support."]</span>
</div>

<div class="form-group" asp-validation-class-for="SubjectExpression">
    <label asp-for="SubjectExpression">@T["Subject"]</label>
    <input type="text" asp-for="SubjectExpression" class="form-control code" />
    <span asp-validation-for="SubjectExpression"></span>
    <span class="hint">@T["The subject of the email message. With Liquid support."]</span>
</div>

<div class="form-group">
    <label asp-for="Body">@T["Body"]</label>
    <textarea asp-for="Body" rows="5" class="form-control"></textarea>
    <span class="hint">@T["The body of the email message. With Liquid support."]</span>
</div>

<div class="form-group">
    <div class="custom-control custom-checkbox">
        <input type="checkbox" class="custom-control-input" asp-for="IsBodyHtml" />
        <label class="custom-control-label" asp-for="IsBodyHtml">@T["Does the Body contain HTML?"]</label>
        <span class="hint">— @T["If checked, indicates the body of the email message is HTML. If unchecked, indicates the body of the email message is plain text."]</span>
    </div>
</div>

<script asp-name="codemirror" depends-on="admin" at="Foot"></script>
<script asp-name="codemirror-mode-javascript" at="Foot"></script>
<script asp-name="codemirror-addon-mode-simple" at="Foot"></script>
<script asp-name="codemirror-addon-mode-multiplex" at="Foot"></script>
<script asp-name="codemirror-mode-xml" at="Foot"></script>
<script asp-src="~/OrchardCore.Liquid/codemirror/liquid.js" at="Foot"></script>

<script at="Foot">
$(function () {
    var editor = CodeMirror.fromTextArea(document.getElementById('@Html.IdFor(x => x.Body)'), {
        lineNumbers: true,
        styleActiveLine: true,
        matchBrackets: true,
        mode: { name: "liquid" },
      });
});
</script>
